<?php

namespace App\Console\Commands;

use App\Models\BusinessInfo;
use App\Models\Company;
use App\Models\CompanyAreaIndustry;
use App\Models\MoneyBook;
use App\Models\MoneyTransaction;
use App\Models\TextAiClean;
use Illuminate\Console\Command;

class Tests extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'test:task {task?}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '测试功能';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $task = $this->argument('task');
        $this->$task();
    }

    protected function ai()
    {
        $ai_models = use_ai_models['format_transaction'];
        $content = '你是谁';
        foreach ($ai_models as $model) {
            log_record($model);
            $res = auto_chat($content, $model);
            log_record($res);
        }
    }

    protected function format()
    {
        $text = '今天午饭吃了10元';
        $format = MoneyTransaction::formatTextByAi($text, MoneyBook::first());
        dd($format);
    }
}
